do not change permissions of invalid items on discovery
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 4 Apr 2025 09:07:28 +0000 (11:07 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 7 Apr 2025 10:53:38 +0000 (10:53 +0000)
if we are going to delete those items, we will make them have the proper
permissions when we need

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discovery.cpp

index 9d7cede827ba021d45f1f26b2186c10006a14536..9939d44739021de1c074426b0889c4fe76a26f7c 100644 (file)
@@ -1871,7 +1871,6 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
             item->_errorString = tr("Not allowed because you don't have permission to add subfolders to that folder");
             const auto localPath = QString{_discoveryData->_localDir + item->_file};
             qCWarning(lcDisco) << "unexpected new folder in a read-only folder will be made read-write" << localPath;
-            FileSystem::setFolderPermissions(localPath, FileSystem::FolderPermissions::ReadWrite);
             emit _discoveryData->remnantReadOnlyFolderDiscovered(item);
             return false;
         } else if (!item->isDirectory() && !perms.hasPermission(RemotePermissions::CanAddFile)) {
@@ -2077,7 +2076,6 @@ int ProcessDirectoryJob::processSubJobs(int nbJobs)
                     _dirItem->_errorString = tr("Not allowed because you don't have permission to add subfolders to that folder");
                     const auto localPath = QString{_discoveryData->_localDir + _dirItem->_file};
                     qCWarning(lcDisco) << "unexpected new folder in a read-only folder will be made read-write" << localPath;
-                    FileSystem::setFolderPermissions(localPath, FileSystem::FolderPermissions::ReadWrite);
                     emit _discoveryData->remnantReadOnlyFolderDiscovered(_dirItem);
                 }